package com.appspile.android.ANMP.ApileIQCA.common;

import java.io.IOException;
import java.io.InputStream;

import android.content.Context;
import android.util.Log;

public class Utils {

	public static String TAG = "UTILS";
	public static Context m_context;
	
	public static void setContext(Context context)
	{
		m_context = context;
	}
	public static String LoadFile(String filePathInAsset)
	{
		String content = "";
		Log.d(TAG,"Loading " + filePathInAsset);
		 try {

	            InputStream is = m_context.getAssets().open(filePathInAsset);

	            int size = is.available();
	            byte[] buffer = new byte[size];
	            is.read(buffer);
	            is.close();
	            content = new String(buffer, "UTF-8");

	        } catch (IOException ex) {
	            ex.printStackTrace();
	            return content;
	        }	
		return content;
	}
}
